<script>
import { h } from '@vue/runtime-core'
export default {
  name: 'XtxBread',
  render(proxy) {
    // 获取默认插槽的内容
    const slot = proxy.$slots.default()
    const arr = []
    console.log(slot)
    slot.forEach((item, index) => {
      arr.push(item)
      if (index < slot.length - 1)
        arr.push(h('i', { class: 'iconfont icon-angle-right' }))
    })

    return h('div', { class: 'xtx-bread' }, arr)
  },
}
</script>

<style lang="less">
// 去除 scoped 属性，目的：然样式作用到xtx-bread-item组件
.xtx-bread {
  display: flex;
  padding: 25px 10px;
  &-item {
    a {
      color: #666;
      transition: all 0.4s;
      &:hover {
        color: @xtxColor;
      }
    }
  }
  i {
    font-size: 12px;
    margin-left: 5px;
    margin-right: 5px;
    line-height: 22px;
  }
}
</style>
